<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"> 

	<h:head>
		<title>New Entry</title>
		<h:outputStylesheet library="css" name="style.css" />
	</h:head>

    <h:body>
    <f:view locale="#{languageBean.currentLocale}">
			<h:form>
				<h:panelGrid columns="2">
					<h:commandLink action="#{languageBean.changeLocale('de_DE')}">
						<h:graphicImage library="img" name="german.jpg" />
					</h:commandLink>
					<h:commandLink action="#{languageBean.changeLocale('en')}">
						<h:graphicImage library="img" name="english.jpg" />
					</h:commandLink>
				</h:panelGrid>
			</h:form>
		</f:view>
        <h:form>
			<h:panelGrid columns="2">
				<h:outputText value="#{msg.guestbook_create_name}" styleClass="h3" />
				<h:inputText id="name" label="name" value="#{createBean.name}" required="true" requiredMessage="#{msg.guestbook_create_name_required}" readonly="true"/>
                <h:outputText value="#{msg.guestbook_create_email}" styleClass="h3" />
                <h:inputText id="email" label="email" value="#{createBean.email}" required="true" requiredMessage="#{msg.guestbook_create_email_required}" validator="emailValidator" validatorMessage="#{msg.guestbook_create_email_invalid}"/>
                <h:outputText value="#{msg.guestbook_create_title}" styleClass="h3" />
                <h:inputText id="title" label="title" value="#{createBean.title}" required="true" requiredMessage="#{msg.guestbook_create_title_required}" />
                <h:outputText value="#{msg.guestbook_create_text}" styleClass="h3" />
                <h:inputText id="text" label="text" value="#{createBean.text}" required="true" requiredMessage="#{msg.guestbook_create_text_required}" />
			</h:panelGrid>
			<br />
			<h:commandButton action="#{createBean.create}" value="#{msg.guestbook_create_action_create}" />
		</h:form>
    </h:body>
</html>
